package com.ruoyi.business.service;

import com.ruoyi.business.domain.CarPackageAudit;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

public interface ProcessService {
    Deployment deploy(String filePath) throws FileNotFoundException;

    InputStream getBpmnInputStream(String deployId);

    InputStream getProcessImg(String deployId);

    ProcessInstance startProcessInstance(String definitionKey, String businessKey, Map<String, Object> variables);

    Task getTaskByProcessInstanceId(String processInstanceId);

    void addCandidateUser(Task currentTask, Long userId);

    /**
     * 根据实例Id查询当前任务
     * @param instanceId
     * @return
     */
    Task selectTaskByInstanceId(String instanceId);

    List<String> getActiveActivityIds(String instanceId);

    /**
     * 查询流程图(高亮)
     * @param processDefinitionId
     * @param highLightedActivities 需要高亮的节点
     * @param highLightedFlows 需要高亮的线
     * @return
     */
    InputStream getProcessImage(String processDefinitionId, List<String> highLightedActivities, List<String>  highLightedFlows);

    ProcessInstance getProcessInstanceByInstanceId(String instanceId);

    void deleteProcessInstance(String instanceId, String tips);

    /**
     * 查询待办任务
     * @param definitionKey
     * @param userId
     * @return
     */
    Long selectTodoTaskListCount(String definitionKey, String userId);

    List<Task> selectTodoTaskList(String definitionKey, String userId, Integer startNum, Integer pageSize);

    Task getTaskByTaskId(String taskId);

    void claimAndComplateTask(Task task, String userId, Boolean auditStatus, String commentStr);
}
